<template>
<el-select v-model="selRoleData" placeholder="请选择" @visible-change="getRoleList" @change="valueChange">
  <el-option v-for="item in roleList" v-bind:label="item.name" v-bind:value="item.id" :key="item.name"></el-option>
</el-select>
</template>
<script>


  import { getRoleList } from '@/api/system'


  export default {
    components: {

    },
    data() {
      return {

        roleList: [],
        selRoleData:""
      }

    },
    created() {
    },
    methods: {

      getRoleList() {
        getRoleList().then(data => {
          this.roleList = data.obj.rows;
        })
      },
      valueChange(value)
      {
        this.$emit("input",value)
      }
    }
  }
</script>
